package cn.yuanqiao.archive.appManager.mapper;

import cn.yuanqiao.archive.appManager.domain.TenantYqda;
import cn.yuanqiao.archive.appManager.domain.TenantYqdaFolder;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author zjj
 * @date 2023/6/15
 */
public interface TenantYqdaMapper {

    /**
     * 创建件总表
     * @param
     * @return
     */
    int createYqdaTable(TenantYqda yqda);

    /**
     * 插入分表
     * @param yqda
     * @return
     */
    int insertYqdaDisperse(TenantYqda yqda);

    /**
     * 插入总表
     * @param yqda
     * @return
     */
    int insertYqda(TenantYqda yqda);

    int updateYqdaDisperse(TenantYqda yqda);

    int updateYqda(TenantYqda yqda);

    int updateYqdaOneColumn(@Param("tableName") String tableName, @Param("columnName")String columnName, @Param("columnVal")String columnVal, @Param("daId")Long daId);

    int updateYqdaOneColumnDisperse(@Param("tableName") String tableName, @Param("columnName")String columnName, @Param("columnVal")String columnVal, @Param("daId")Long daId);

    Map<String, Object> getYqdaById(@Param("column")String column, @Param("id") Long id, @Param("tableName") String tableName);

    Map<String, Object> getYqdaAllById(@Param("column")String column, @Param("id") Long id, @Param("tableName") String tableName);

    Long[] getDaIdsByFolderIds(@Param("ids")Long[] ids, @Param("fileTableName") String fileTableName, @Param("tableName") String tableName);

    int updateYqdaByIds(@Param("yqda")TenantYqda yqda, @Param("ids") List<Long> ids);
    int updateYqdaByIds2(@Param("yqda")TenantYqda yqda, @Param("ids") List<Long> ids);

    int updateYqdaDisperseByIds(@Param("yqda")TenantYqda yqda, @Param("ids") List<Long> ids);
    int updateYqdaDisperseByIds2(@Param("yqda")TenantYqda yqda, @Param("ids") List<Long> ids);

    int addYqdaFolder(TenantYqdaFolder yqdaFolder);

    Long getFolderId(@Param("juanDh")String juanDh, @Param("dhValue") String dhValue, @Param("folderTableName") String folderTableName);

    int DhIsNull(@Param("ids")List<Long> ids, @Param("jianDhCol") String jianDhCol, @Param("fileTableName") String fileTableName);

    int updateEfileCount(@Param("daId")Long daId, @Param("idName")String idName, @Param("type")Integer type, @Param("tableName") String tableName);

    Integer getCountByCol(@Param("checkChongfu")String checkChongfu, @Param("val")String val, @Param("tableName")String tableName);

    Integer getMaxJianMj(@Param("daIdsStr")String daIdsStr, @Param("fileTableName") String fileTableName);

    Integer getMaxJianMjByFolderIds(@Param("folderIdsStr")String folderIdsStr, @Param("fileTableName") String fileTableName, @Param("tableName")String tableName);

    int updateStateByPackageId(@Param("state")int state,@Param("yqdaTableName") String yqdaTableName,@Param("onLineTableName") String onLineTableName,@Param("onlineReceptionId")Long onlineReceptionId);

    void delYqdaByIdList(@Param("tableName")String tableName,@Param("ids") List<Long> ids);

    void delYqda(@Param("daId")Long daId,@Param("tableName") String tableName);

    List<Map<String,Object>> getYqdaAll(@Param("tableName") String tableName,@Param("whereStr") String whereStr);

}
